Category: Geeks r Us
Hey all,
I am trying to write a JAWS script to get a list of who is actually online (as opposed to away, busy, etc) in Windows Live Messenger version 8.5.1302. This is what I know:
The contact list is a group of MSAA objects that is mixed in with everything else on the screen, like the buttons, status menu, ads, etc.
Querying the accName, accDescription, accValue, and accHelp properties for any object representing a contact in the contact list returns the same thing.
Getting the text of the rectangle for the object whose name is "Online" returns "Online (x)" where x is the number of people visible.
This is what I have so far:
Script SayOnlineList ()
var
object o,
int childID,
handle hwnd,
int i,
int j,
string list,
int virtualize
let hwnd=getFocus()
if !stringContains(getWindowClass(hwnd), "DirectUIHWND") then
return
say("Not on contact list", OT_ERROR)
endIf
let o=getObjectAtPoint(childID, getCursorCol(), getCursorRow())
EndScript
Tyler
I think in Windows Live Messenger, it already says who is online. It just sorts the contacts into groups. At least that's what it did for mine. You might have to change the sort thing in the contacts menu.
No, that's not what I'm trying to do. I'm trying to make JAWS speak, on a single keystroke, the people whose status is "Online" and not the other status options (away, busy, etc).
tyler, what's the point? just look at the list and sort them out yourself
I get where Tyler is coming from, simular to the online keystroke in Skype, right?
If you don't want Tyler's script, don't use it. Writing something like is a good way to teach yourself the interface.
Good point, Dave. And Mikey, you could do that, but what if you have a lot of contacts, like I do (I have 51 contacts on my list)?
Yes, I get what he wants to do. In the latest scripts for skype, it's possible to press control plus o, I believe it is? and have all the contacts who are currently online. for example, you might hear, 5 contacts online. folloed by their names, in alphabetical order. I think this could definitely be handy.
i've never been able to get the skype script to work. and you're not the only one witha lot of contacts tyler
Yeah i think it would be cool to have the wquivilant of skypewatch and the command key for wlm. Speaking of wlm, it won't read msg's automatically anymore, with the option in verbosity turned on. I didn't do anything to it.
I didn't know there was a script to do a similar thing on skype. I thought it was just done automatically.
This is all the code I have written so far, and it looks complete, but the darned thing still isn't working. There was one point where I had written some code which had gotten me into an infinite loop, but I resolved that and tried something else (which is what I have in this code), but it still won't do what it's supposed to do.
;SayOnlineList script and supporting code. Written by TK, 2008-05-29 through 2008-05-31.
Const
;Constant to represent the child ID of the object itself, taken from skypeMSAA.jsh (a direct translation of parts of oleacc.h and winable.h, MSAA SDK).
childID_self=0
String Function wlStringCat (string s1, string s2)
;Adapted from the olStringCat and aimstringCat functions written by Doug Lee (<dgl@dlee.org>, Bartimaeus Group).
return stringChopLeft(""+s1+s2, 1)
EndFunction
Script SayOnlineList ()
var
object o,
int childID,
handle hwnd,
int i,
string list,
string temp,
int virtualize
let virtualize=isSameScript()
let hwnd=getFocus()
if !stringContains(getWindowClass(hwnd), "DirectUIHWND") then
return
say("Not on contact list", OT_ERROR)
endIf
PCCursor()
jawsTopOfFile()
let o=getObjectAtPoint(childID, getCursorCol(), getCursorRow())
if stringContains(stringLower(o.accName(childID_self)), "online (") then
let i=0
let list=""
;I have to do it this way (by using the JAWS cursor) because previous methods have not worked. [TK, 2008-05-31]
jawsHome()
saveCursor() jawsCursor() saveCursor()
routeJAWSToPC()
while (!stringContains(stringLower(o.accName(childID_self)), "mobile")) || (!stringContains(stringLower(o.accName(childID)), "offline"))
nextLine()
jawsHome()
let o=getObjectAtPoint(childID, getCursorCol(), getCursorRow())
let temp=o.accName(childID_self)
if stringContains(stringLower(temp), "(online)") then
let i=i+1
let temp=stringLower(temp)
let list=wlStringCat(list, "rn"+stringChopRight(temp, stringLength("(online)")))
jawsHome()
endIf
endWhile
let list=wlStringCat(intToString(i)+" contacts online:", "rn"+list)
if virtualize then
sayFormattedMessage(OT_USER_BUFFER, list)
else
sayFormattedMessage(OT_USER_REQUESTED_INFORMATION, list, "")
endIf
endIf
EndScript
Could someone look at this and see what I'm doing wrong?
i dont know much about jaws scripting, but it probably gets stuck at the quick search edit?